import request, {buildQueryString} from "@/utils/request"
export function getDeptList(data?: {deptName?: string;dataStatus?: number}) {
    return request.get(`/dept/list${buildQueryString(data)}`)
}
export function getDeptById(id: number) {
    return request.get(`/dept/getDeptById/${id}`)
}
export function delDeptById(id: number) {
    return request.delete(`/dept/delById/${id}`)
}
// eslint-disable-next-line
export function addDeptForm(data: {name:string,parentId?:number,sort:number,dataStatus:number}) {
    return request.post(`/dept`,data)
}
export type updateDeptForm ={id: number;name: string;parentId: number;sort: number;dataStatus: number}
export function updateDept(data: updateDeptForm ) {
    return request.put("/dept",data)
}
